//
//  Constants.h
//  FundChain
//
//  Created by 肖浩然的mac on 2018/2/6.
//  Copyright © 2018年 RUIXIN. All rights reserved.
//

#ifndef Constants_h
#define Constants_h

#define  AppShare [AppDelegate sharedAppDelegate]
#define GreatThanIOS7 ([[UIDevice currentDevice].systemVersion doubleValue] > 7.0)

/**AppDelegate*/
#define appDelegate     ((AppDelegate *)[[UIApplication sharedApplication] delegate])

/**屏幕*/
#define SCREEN_WIDTH    ([UIScreen mainScreen].bounds.size.width)
#define SCREEN_HEIGHT   ([UIScreen mainScreen].bounds.size.height)

//屏幕比例与获取屏幕宽高(750*1334图中)
#define KScreenWidthScale750 [UIScreen mainScreen].bounds.size.width/750
#define KScreenHeightScale1334 [UIScreen mainScreen].bounds.size.height/1334
#pragma mark - 设备型号识别
#define is_IOS_8 ([[[UIDevice currentDevice] systemVersion] floatValue] >= 8.0)
#define is_IOS_9 ([[[UIDevice currentDevice] systemVersion] floatValue] >= 9.0)
#define is_IOS_10 ([[[UIDevice currentDevice] systemVersion] floatValue] >= 10.0)
#define is_IOS_11 ([[[UIDevice currentDevice] systemVersion] floatValue] >= 11.0)
//判断iPhone尺寸
#define iPhone4 ([UIScreen mainScreen].bounds.size.height==480)&&([UIScreen mainScreen].bounds.size.width==320)
#define iPhone5 ([UIScreen mainScreen].bounds.size.height==568)&&([UIScreen mainScreen].bounds.size.width==320)
#define iPhone6 ([UIScreen mainScreen].bounds.size.height==667)&&([UIScreen mainScreen].bounds.size.width==375)
#define iPhone6p ([UIScreen mainScreen].bounds.size.height==736)&&([UIScreen mainScreen].bounds.size.width==414)
#define iPhoneX ([UIScreen mainScreen].bounds.size.height==812)&&([UIScreen mainScreen].bounds.size.width==375)

#define i5_i6H 568 / 667
#define i6p_6H 736 / 667
#define iX_i6H 812 / 667

#define i5_i6W 320 / 375
#define i6p_6W 414 / 375
#define iX_i6W 375 / 375


#define kDistance20 20
#define kDistance5 5
#define kDistance10 10
#define kDistance25 25
#define kDistance30 30
#define kDistance40 40
#define kDistance50 50

#define kDistance15 15
#define kDistance60 60
#define kDistance70 70
#define kDistance105 105

#define kSpacingDistance 10
#define kNavHeight    64
#define kTabbarHeight 44

//判断字符串是否为空
#define kStringIsEmpty(str) ([str isKindOfClass:[NSNull class]] || str == nil || [[str stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]] length] < 1 ? YES : NO )
//判断数组是否为空
#define kArrayIsEmpty(array) (array == nil || [array isKindOfClass:[NSNull class]] || array.count == 0)

#define IS_VAILABLE_IOS8  ([[[UIDevice currentDevice] systemVersion] intValue] >= 8)

#define  SoftVersion    [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleShortVersionString"]
#pragma mark -- 颜色

/**RGB颜色*/
#define   RGB(r, g, b)     [UIColor colorWithRed:(r)/255.0f green:(g)/255.0f blue:(b)/255.0f alpha:1.0f]
#define   ZLColor(r, g, b)     [UIColor colorWithRed:(r)/255.0f green:(g)/255.0f blue:(b)/255.0f alpha:1.0f]
#define   ZLAColor(r, g, b, a) [UIColor colorWithRed:(r)/255.0f green:(g)/255.0f blue:(b)/255.0f alpha:(a)]
#define   ZLRandomColor        [UIColor colorWithRed:(arc4random() % 255) / 255.0f green:(arc4random() % 255) / 255.0f blue:(arc4random() % 255) / 255.0f alpha:1.0]

/**HEX颜色*/
#define   HEXCOLOR(rgbValue)  [UIColor colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 green:((float)((rgbValue & 0xFF00) >> 8))/255.0 blue:((float)(rgbValue & 0xFF))/255.0 alpha:1.0]
#define HEXACOLOR(rgbValue,a) [UIColor colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 green:((float)((rgbValue & 0xFF00) >> 8))/255.0 blue:((float)(rgbValue & 0xFF))/255.0 alpha:a]

#define KOverstrikingfont(SIZE)  [UIFont fontWithName:@ "Arial Rounded MT Bold"  size:(SIZE/2)]

#define Kfont(SIZE)  [UIFont systemFontOfSize:SIZE/2]

#define kRedOrangeColor      HEXCOLOR(0x006fb6)  //主色调
#define kLightblueColor      HEXCOLOR(0x99c5e2)  //淡主色调
#define kwarningColor        HEXCOLOR(0xbf3939)  //红褐色警告
#define kgreenassistColor    HEXCOLOR(0x3d993d)  //绿色辅助
#define kBackgroungdColor    HEXCOLOR(0xf0f2f5)  //主背景色
#define kCellBackGroundColor HEXCOLOR(0xf8f8f8)  //有颜色的cell的背景颜色
#define kWhiteColor          HEXCOLOR(0xffffff)  //白色
#define kBlackColor          HEXCOLOR(0x111111)  //黑色
#define kShawdowColor        HEXCOLOR(0x000000)  //店铺的header shadowColor
#define kDarkBlackColor      HEXCOLOR(0x333333)  //黑色字体
#define kOrderColor          HEXCOLOR(0x666666)  //购物车订单号颜色
#define kLightBlackColor     HEXCOLOR(0x3d3d3d)  //浅黑色字体
#define kGrayColor           HEXCOLOR(0x999999)  //灰色字体
#define kGrayBgColor         HEXCOLOR(0xe8e8e8)  //浅灰色，以及table 分区头颜色
#define kCartHeaderColor     HEXCOLOR(0xf8f8f8)  //cart的头部颜色
#define kCartTableHeader     HEXCOLOR(0xe6e6e6)  //cart的tableHeader颜色
#define kTimeColor           HEXCOLOR(0xcccccc)  //message时间颜色,borderColor
#define kLineColor           HEXCOLOR(0xe3e5e9)  //分解线颜色dddddd
#define kerrorColor          HEXCOLOR(0x838383)  //error字体颜色
//#define kWarningColor        HEXCOLOR(0xf54d4d)  //Warning字体颜色
#define kFAQTitleColor       HEXCOLOR(0x4caf50)  //FAQ字体颜色
#define kBtnPressedColor     HEXCOLOR(0xd32f2f)  //按钮按下的颜色
#define kOfflineBtnPressedColor      HEXCOLOR(0xe88a00)  //按钮按下的颜色
#define kAccountTextColor    HEXCOLOR(0x787878)  //账户页面里completed amount
#define kPaybtnColor         HEXCOLOR(0xd32f2f)  //购物车页面支付按钮选中颜色
#define kCartCountColor      HEXCOLOR(0x545454)  //购物车页面购买数量颜色
#define korderStatusLine     HEXCOLOR(0xf1f1f1)  //订单时间轴
#define korderStatusLineSelected     HEXCOLOR(0xe9f5dc)  //订单时间轴选中色
#define korderGiftDesc       HEXCOLOR(0xaaaaaa)  //订单赠送物品描述颜色

#define kTabbarBackgourd    ZLColor(70,85,106)
#define kTabbarItemColor    ZLColor(115,133,158)

#define kDefaultButtonColor  ZLColor(49,60,104)  //默认按钮颜色
#define kDefaultGreenColor   HEXCOLOR(0x74c543)  //默认绿色按钮
#define kDefaultTextColor    HEXCOLOR(0x96acbb)  //默认字体颜色
#define kTextGrayColor       RGB(161, 162, 162)
#define kTextOrangeColor     HEXCOLOR(0xfc9c26)  //桔黄色字体颜色
#define kErrorTextColor      ZLColor(250,155,53) //默认警告字体颜色
#define kBoardLineColor      HEXCOLOR(0xc2c8cc)  //登录注册文本框边线颜色

#define KDefaultBlueColor    RGB(105, 195, 244)   //默认系统蓝色

#define kNavBarBackColor     ZLColor(70,85,106)    //导航背景颜色

#define kButtonStateNormalColor   HEXCOLOR(0x72859F)
#define KButtonStateSelectColor   HEXCOLOR(0x60748E)
//#define kNavBarBackColor     RGB(45, 55, 95)    //导航背景颜色

#define kClearColor          [UIColor clearColor]

#endif /* Constants_h */
